Skip to content

Add a distinct error code and description for "main function has wron… #38819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 26, 2017

Conversation

GuillaumeGomez
Copy link
Member

…g type"

@rust-highfive
Copy link
Contributor

r? @arielb1

(rust_highfive has picked a reviewer for you, use r? to override)

}
```

If you to get command-line arguments, use `std::env::args`. To exit with a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you to [...]

missing verb?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely.

@GuillaumeGomez GuillaumeGomez force-pushed the main_func_wrong_type branch 2 times, most recently from 87cdd7e to 616c916 Compare January 5, 2017 16:47
@GuillaumeGomez
Copy link
Member Author

Updated.

}
```

The `main` function prototype should always be the following:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust doesn't have function prototypes so this term is sort of out of the blue. I think showing the correct shape of the function as in the next code example is fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Less is more I guess. ;)

@GuillaumeGomez
Copy link
Member Author

Updated.

@GuillaumeGomez
Copy link
Member Author

r? @jonathandturner

@rust-highfive rust-highfive assigned sophiajt and unassigned arielb1 Jan 12, 2017
@GuillaumeGomez
Copy link
Member Author

Anyone? 😢

@sophiajt
Copy link
Contributor

@GuillaumeGomez - it looks good, but I was curious - why did the error number change?

-fn main() -> i32 { 0 } //~ ERROR E0308
+fn main() -> i32 { 0 } //~ ERROR E0579

@GuillaumeGomez
Copy link
Member Author

Because the error changed. That's the main purpose of this PR. ;)

@GuillaumeGomez
Copy link
Member Author

@jonathandturner: Anything else I need to do?

@sophiajt
Copy link
Contributor

@GuillaumeGomez sorry, I thought you had repurposed an older one. Looks good.

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 25, 2017

📌 Commit f0b6001 has been approved by jonathandturner

@bors
Copy link
Collaborator

bors commented Jan 25, 2017

⌛ Testing commit f0b6001 with merge 9161339...

@bors
Copy link
Collaborator

bors commented Jan 25, 2017

💔 Test failed - status-travis

@GuillaumeGomez
Copy link
Member Author

@bors: retry

@bors
Copy link
Collaborator

bors commented Jan 25, 2017

⌛ Testing commit f0b6001 with merge 3104cb2...

@bors
Copy link
Collaborator

bors commented Jan 25, 2017

💔 Test failed - status-travis

@sophiajt
Copy link
Contributor

Tidy failures

Building stage0 tool tidy (x86_64-unknown-linux-gnu)

   Compiling tidy v0.1.0 (file:///checkout/src/tools/tidy)

    Finished release [optimized] target(s) in 5.27 secs

tidy check (x86_64-unknown-linux-gnu)

duplicate error code: 579

/checkout/src/librustc/diagnostics.rs:1697: E0579: r##"

/checkout/src/librustc_passes/diagnostics.rs:227: E0579: r##"

thread 'main' panicked at 'some tidy checks failed', /checkout/src/tools/tidy/src/main.rs:55

note: Run with `RUST_BACKTRACE=1` for a backtrace.

@GuillaumeGomez
Copy link
Member Author

Damn... We waited for too long and a new error code has been added... I'll update the error code number tomorrow...

@GuillaumeGomez
Copy link
Member Author

I replaced E0579 with E0580. I'll r+, don't hesitate to r- @jonathandturner if you see anything.

@bors: r+

@bors
Copy link
Collaborator

bors commented Jan 26, 2017

📌 Commit 97b9c8b has been approved by GuillaumeGomez

@bors
Copy link
Collaborator

bors commented Jan 26, 2017

⌛ Testing commit 97b9c8b with merge 07fe04c...

bors added a commit that referenced this pull request Jan 26, 2017
…meGomez

Add a distinct error code and description for "main function has wron…

…g type"
@bors
Copy link
Collaborator

bors commented Jan 26, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: GuillaumeGomez
Pushing 07fe04c to master...

@bors bors merged commit 97b9c8b into rust-lang:master Jan 26, 2017
@GuillaumeGomez GuillaumeGomez deleted the main_func_wrong_type branch January 26, 2017 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants